package com.newland.starpos.partner.exception;

import com.newland.starpos.partner.http.ResponseEnum;
import lombok.Getter;

@Getter
public class CustomException extends Exception {

    private static final long serialVersionUID = 1L;

    private int code;

    private Object params;

    public CustomException(ResponseEnum responseEnum) {
        this(responseEnum.code(), responseEnum.message());
    }

    public CustomException(int code, String msg) {
        this(code, msg, null);
    }

    public CustomException(ResponseEnum responseEnum, Object params) {
        this(responseEnum.code(), responseEnum.message(), params);
    }

    public CustomException(int code, String msg, Object params) {
        super(msg);
        this.code = code;
        this.params = params;
    }
}
